package com.rain.shoppingscienceproj.ui.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;

/**
 * ========================================================
 * <p>
 * Author：admin
 * Time  ：2018-09-02 15:53
 * Desc  ：
 * <p>
 * ========================================================
 */
public class OrderTitleAdapter extends FragmentPagerAdapter {

    private final String[] TITLES = {"全部", "待付款", "待发货", "待收货", "待评价"};
    private ArrayList<Fragment> mFragments;

    public OrderTitleAdapter(FragmentManager fm, ArrayList<Fragment> mFragments) {
        super(fm);
        this.mFragments = mFragments;
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }

    @Override
    public int getCount() {
        return TITLES.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return TITLES[position];
    }

}
